public class StringEndHandler implements StateHandler {
    private final StateMachine stateMachine;

    public StringEndHandler(StateMachine stateMachine) {
        this.stateMachine = stateMachine;
    }

    @Override
    public void handleChar(char ch, StringBuilder currentString, StateMachine stateMachine) {
        stateMachine.setState(State.INITIAL);
    }
}